package com.situ.day1;

import org.junit.Test;

public class HelloWorld {
	
	public static void main(String[] args) {
		System.out.println("HelloWorld!");
		//经验值：70
		int jinYanZhi = 70;
		//num = 80;
		byte age = 20;
		int age1 = 20; 
		//Type mismatch: cannot convert from double to float
		float f = 3.14f;
		double d = 3.14;
	}
	
	@Test
	public void test1() {
		char ch1 = 'a';
		System.out.println(ch1);
		char ch2 = '中';
		// syso
		System.out.println(ch2);
	}
	
	@Test
	public void test2() {
		char ch = 'a';//在编码表里面a对应97
		System.out.println(ch);
		System.out.println(ch + 1);//97+1=98从小到大自动类型转换
		System.out.println(ch + 2);//97+2=99从小到大自动类型转换
		System.out.println((char)(ch + 1));//b 从大到小需要强制类型转换
		System.out.println((char)(ch + 2));//c 从大到小需要强制类型转换
		System.out.println((int)3.14);//3 丢失精度
	}
	
	
}
